<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="de">
<head>
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>RandomStringUtils (Apache Commons Lang 3.3.2 API)</title>
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="RandomStringUtils (Apache Commons Lang 3.3.2 API)";
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!--   -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/RandomStringUtils.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/commons/lang3/ObjectUtils.Null.html" title="class in org.apache.commons.lang3"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../org/apache/commons/lang3/RandomUtils.html" title="class in org.apache.commons.lang3"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/commons/lang3/RandomStringUtils.html" target="_top">Frames</a></li>
<li><a href="RandomStringUtils.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.commons.lang3</div>
<h2 title="Class RandomStringUtils" class="title">Class RandomStringUtils</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>org.apache.commons.lang3.RandomStringUtils</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="strong">RandomStringUtils</span>
extends <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
<div class="block"><p>Operations for random <code>String</code>s.</p>
 <p>Currently <em>private high surrogate</em> characters are ignored. 
 These are Unicode characters that fall between the values 56192 (db80)
 and 56319 (dbff) as we don't know how to handle them. 
 High and low surrogates are correctly dealt with - that is if a 
 high surrogate is randomly chosen, 55296 (d800) to 56191 (db7f) 
 then it is followed by a low surrogate. If a low surrogate is chosen, 
 56320 (dc00) to 57343 (dfff) then it is placed after a randomly 
 chosen high surrogate. </p>

 <p>#ThreadSafe#</p></div>
<dl><dt><span class="strong">Since:</span></dt>
  <dd>1.0</dd>
<dt><span class="strong">Version:</span></dt>
  <dd>$Id: RandomStringUtils.java 1532684 2013-10-16 08:28:42Z bayard $</dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!--   -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../org/apache/commons/lang3/RandomStringUtils.html#RandomStringUtils()">RandomStringUtils</a></strong>()</code>
<div class="block"><code>RandomStringUtils</code> instances should NOT be constructed in
 standard programming.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/lang3/RandomStringUtils.html#random(int)">random</a></strong>(int&nbsp;count)</code>
<div class="block">Creates a random string whose length is the number of characters
 specified.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/lang3/RandomStringUtils.html#random(int, boolean, boolean)">random</a></strong>(int&nbsp;count,
      boolean&nbsp;letters,
      boolean&nbsp;numbers)</code>
<div class="block">Creates a random string whose length is the number of characters
 specified.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/lang3/RandomStringUtils.html#random(int, char...)">random</a></strong>(int&nbsp;count,
      char...&nbsp;chars)</code>
<div class="block">Creates a random string whose length is the number of characters
 specified.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/lang3/RandomStringUtils.html#random(int, int, int, boolean, boolean)">random</a></strong>(int&nbsp;count,
      int&nbsp;start,
      int&nbsp;end,
      boolean&nbsp;letters,
      boolean&nbsp;numbers)</code>
<div class="block">Creates a random string whose length is the number of characters
 specified.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/lang3/RandomStringUtils.html#random(int, int, int, boolean, boolean, char...)">random</a></strong>(int&nbsp;count,
      int&nbsp;start,
      int&nbsp;end,
      boolean&nbsp;letters,
      boolean&nbsp;numbers,
      char...&nbsp;chars)</code>
<div class="block">Creates a random string based on a variety of options, using
 default source of randomness.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/lang3/RandomStringUtils.html#random(int, int, int, boolean, boolean, char[], java.util.Random)">random</a></strong>(int&nbsp;count,
      int&nbsp;start,
      int&nbsp;end,
      boolean&nbsp;letters,
      boolean&nbsp;numbers,
      char[]&nbsp;chars,
      <a href="http://docs.oracle.com/javase/6/docs/api/java/util/Random.html?is-external=true" title="class or interface in java.util">Random</a>&nbsp;random)</code>
<div class="block">Creates a random string based on a variety of options, using
 supplied source of randomness.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/lang3/RandomStringUtils.html#random(int, java.lang.String)">random</a></strong>(int&nbsp;count,
      <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;chars)</code>
<div class="block">Creates a random string whose length is the number of characters
 specified.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/lang3/RandomStringUtils.html#randomAlphabetic(int)">randomAlphabetic</a></strong>(int&nbsp;count)</code>
<div class="block">Creates a random string whose length is the number of characters
 specified.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/lang3/RandomStringUtils.html#randomAlphanumeric(int)">randomAlphanumeric</a></strong>(int&nbsp;count)</code>
<div class="block">Creates a random string whose length is the number of characters
 specified.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/lang3/RandomStringUtils.html#randomAscii(int)">randomAscii</a></strong>(int&nbsp;count)</code>
<div class="block">Creates a random string whose length is the number of characters
 specified.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/lang3/RandomStringUtils.html#randomNumeric(int)">randomNumeric</a></strong>(int&nbsp;count)</code>
<div class="block">Creates a random string whose length is the number of characters
 specified.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!--   -->
</a>
<h3>Constructor Detail</h3>
<a name="RandomStringUtils()">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>RandomStringUtils</h4>
<pre>public&nbsp;RandomStringUtils()</pre>
<div class="block"><p><code>RandomStringUtils</code> instances should NOT be constructed in
 standard programming. Instead, the class should be used as
 <code>RandomStringUtils.random(5);</code>.</p>

 <p>This constructor is public to permit tools that require a JavaBean instance
 to operate.</p></div>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="random(int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>random</h4>
<pre>public static&nbsp;<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;random(int&nbsp;count)</pre>
<div class="block"><p>Creates a random string whose length is the number of characters
 specified.</p>

 <p>Characters will be chosen from the set of all characters.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>count</code> - the length of random string to create</dd>
<dt><span class="strong">Returns:</span></dt><dd>the random string</dd></dl>
</li>
</ul>
<a name="randomAscii(int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>randomAscii</h4>
<pre>public static&nbsp;<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;randomAscii(int&nbsp;count)</pre>
<div class="block"><p>Creates a random string whose length is the number of characters
 specified.</p>

 <p>Characters will be chosen from the set of characters whose
 ASCII value is between <code>32</code> and <code>126</code> (inclusive).</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>count</code> - the length of random string to create</dd>
<dt><span class="strong">Returns:</span></dt><dd>the random string</dd></dl>
</li>
</ul>
<a name="randomAlphabetic(int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>randomAlphabetic</h4>
<pre>public static&nbsp;<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;randomAlphabetic(int&nbsp;count)</pre>
<div class="block"><p>Creates a random string whose length is the number of characters
 specified.</p>

 <p>Characters will be chosen from the set of alphabetic
 characters.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>count</code> - the length of random string to create</dd>
<dt><span class="strong">Returns:</span></dt><dd>the random string</dd></dl>
</li>
</ul>
<a name="randomAlphanumeric(int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>randomAlphanumeric</h4>
<pre>public static&nbsp;<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;randomAlphanumeric(int&nbsp;count)</pre>
<div class="block"><p>Creates a random string whose length is the number of characters
 specified.</p>

 <p>Characters will be chosen from the set of alpha-numeric
 characters.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>count</code> - the length of random string to create</dd>
<dt><span class="strong">Returns:</span></dt><dd>the random string</dd></dl>
</li>
</ul>
<a name="randomNumeric(int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>randomNumeric</h4>
<pre>public static&nbsp;<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;randomNumeric(int&nbsp;count)</pre>
<div class="block"><p>Creates a random string whose length is the number of characters
 specified.</p>

 <p>Characters will be chosen from the set of numeric
 characters.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>count</code> - the length of random string to create</dd>
<dt><span class="strong">Returns:</span></dt><dd>the random string</dd></dl>
</li>
</ul>
<a name="random(int, boolean, boolean)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>random</h4>
<pre>public static&nbsp;<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;random(int&nbsp;count,
            boolean&nbsp;letters,
            boolean&nbsp;numbers)</pre>
<div class="block"><p>Creates a random string whose length is the number of characters
 specified.</p>

 <p>Characters will be chosen from the set of alpha-numeric
 characters as indicated by the arguments.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>count</code> - the length of random string to create</dd><dd><code>letters</code> - if <code>true</code>, generated string may include
  alphabetic characters</dd><dd><code>numbers</code> - if <code>true</code>, generated string may include
  numeric characters</dd>
<dt><span class="strong">Returns:</span></dt><dd>the random string</dd></dl>
</li>
</ul>
<a name="random(int, int, int, boolean, boolean)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>random</h4>
<pre>public static&nbsp;<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;random(int&nbsp;count,
            int&nbsp;start,
            int&nbsp;end,
            boolean&nbsp;letters,
            boolean&nbsp;numbers)</pre>
<div class="block"><p>Creates a random string whose length is the number of characters
 specified.</p>

 <p>Characters will be chosen from the set of alpha-numeric
 characters as indicated by the arguments.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>count</code> - the length of random string to create</dd><dd><code>start</code> - the position in set of chars to start at</dd><dd><code>end</code> - the position in set of chars to end before</dd><dd><code>letters</code> - if <code>true</code>, generated string may include
  alphabetic characters</dd><dd><code>numbers</code> - if <code>true</code>, generated string may include
  numeric characters</dd>
<dt><span class="strong">Returns:</span></dt><dd>the random string</dd></dl>
</li>
</ul>
<a name="random(int, int, int, boolean, boolean, char...)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>random</h4>
<pre>public static&nbsp;<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;random(int&nbsp;count,
            int&nbsp;start,
            int&nbsp;end,
            boolean&nbsp;letters,
            boolean&nbsp;numbers,
            char...&nbsp;chars)</pre>
<div class="block"><p>Creates a random string based on a variety of options, using
 default source of randomness.</p>

 <p>This method has exactly the same semantics as
 <a href="../../../../org/apache/commons/lang3/RandomStringUtils.html#random(int, int, int, boolean, boolean, char[], java.util.Random)"><code>random(int,int,int,boolean,boolean,char[],Random)</code></a>, but
 instead of using an externally supplied source of randomness, it uses
 the internal static <a href="http://docs.oracle.com/javase/6/docs/api/java/util/Random.html?is-external=true" title="class or interface in java.util"><code>Random</code></a> instance.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>count</code> - the length of random string to create</dd><dd><code>start</code> - the position in set of chars to start at</dd><dd><code>end</code> - the position in set of chars to end before</dd><dd><code>letters</code> - only allow letters?</dd><dd><code>numbers</code> - only allow numbers?</dd><dd><code>chars</code> - the set of chars to choose randoms from.
  If <code>null</code>, then it will use the set of all chars.</dd>
<dt><span class="strong">Returns:</span></dt><dd>the random string</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/ArrayIndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">ArrayIndexOutOfBoundsException</a></code> - if there are not
  <code>(end - start) + 1</code> characters in the set array.</dd></dl>
</li>
</ul>
<a name="random(int, int, int, boolean, boolean, char[], java.util.Random)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>random</h4>
<pre>public static&nbsp;<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;random(int&nbsp;count,
            int&nbsp;start,
            int&nbsp;end,
            boolean&nbsp;letters,
            boolean&nbsp;numbers,
            char[]&nbsp;chars,
            <a href="http://docs.oracle.com/javase/6/docs/api/java/util/Random.html?is-external=true" title="class or interface in java.util">Random</a>&nbsp;random)</pre>
<div class="block"><p>Creates a random string based on a variety of options, using
 supplied source of randomness.</p>

 <p>If start and end are both <code>0</code>, start and end are set
 to <code>' '</code> and <code>'z'</code>, the ASCII printable
 characters, will be used, unless letters and numbers are both
 <code>false</code>, in which case, start and end are set to
 <code>0</code> and <code>Integer.MAX_VALUE</code>.

 <p>If set is not <code>null</code>, characters between start and
 end are chosen.</p>

 <p>This method accepts a user-supplied <a href="http://docs.oracle.com/javase/6/docs/api/java/util/Random.html?is-external=true" title="class or interface in java.util"><code>Random</code></a>
 instance to use as a source of randomness. By seeding a single 
 <a href="http://docs.oracle.com/javase/6/docs/api/java/util/Random.html?is-external=true" title="class or interface in java.util"><code>Random</code></a> instance with a fixed seed and using it for each call,
 the same random sequence of strings can be generated repeatedly
 and predictably.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>count</code> - the length of random string to create</dd><dd><code>start</code> - the position in set of chars to start at</dd><dd><code>end</code> - the position in set of chars to end before</dd><dd><code>letters</code> - only allow letters?</dd><dd><code>numbers</code> - only allow numbers?</dd><dd><code>chars</code> - the set of chars to choose randoms from, must not be empty.
  If <code>null</code>, then it will use the set of all chars.</dd><dd><code>random</code> - a source of randomness.</dd>
<dt><span class="strong">Returns:</span></dt><dd>the random string</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/ArrayIndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">ArrayIndexOutOfBoundsException</a></code> - if there are not
  <code>(end - start) + 1</code> characters in the set array.</dd>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if <code>count</code> &lt; 0 or the provided chars array is empty.</dd><dt><span class="strong">Since:</span></dt>
  <dd>2.0</dd></dl>
</li>
</ul>
<a name="random(int, java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>random</h4>
<pre>public static&nbsp;<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;random(int&nbsp;count,
            <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;chars)</pre>
<div class="block"><p>Creates a random string whose length is the number of characters
 specified.</p>

 <p>Characters will be chosen from the set of characters
 specified by the string, must not be empty. 
 If null, the set of all characters is used.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>count</code> - the length of random string to create</dd><dd><code>chars</code> - the String containing the set of characters to use,
  may be null, but must not be empty</dd>
<dt><span class="strong">Returns:</span></dt><dd>the random string</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if <code>count</code> &lt; 0 or the string is empty.</dd></dl>
</li>
</ul>
<a name="random(int, char...)">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>random</h4>
<pre>public static&nbsp;<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;random(int&nbsp;count,
            char...&nbsp;chars)</pre>
<div class="block"><p>Creates a random string whose length is the number of characters
 specified.</p>

 <p>Characters will be chosen from the set of characters specified.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>count</code> - the length of random string to create</dd><dd><code>chars</code> - the character array containing the set of characters to use,
  may be null</dd>
<dt><span class="strong">Returns:</span></dt><dd>the random string</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if <code>count</code> &lt; 0.</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!--   -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/RandomStringUtils.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/commons/lang3/ObjectUtils.Null.html" title="class in org.apache.commons.lang3"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../org/apache/commons/lang3/RandomUtils.html" title="class in org.apache.commons.lang3"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/commons/lang3/RandomStringUtils.html" target="_top">Frames</a></li>
<li><a href="RandomStringUtils.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2001&#x2013;2014 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>
